<%--
  Created by IntelliJ IDEA.
  User: 10300
  Date: 2021/10/25
  Time: 17:15
  To change this template use File | Settings | File Templates.
--%>
<%--
  Created by IntelliJ IDEA.
  User: 19143
  Date: 2021/10/24
  Time: 22:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%String path = request.getContextPath();%>
<html>
<head>
    <meta charset="UTF-8">
    <title>订单列表</title>
    <link type="text/css" rel="stylesheet" href="fontsawesome/css/font-awesome.css"/>
    <link type="text/css" rel="stylesheet" href="css/datepicker.css"/>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
</head>
<body>
<div class="main_box">
    <h2><span></span>订单列表</h2>
    <form action="#" method="post" id="order_shform">
        <div class="search_box clearfix">
            <input type="text" class="f_left" name="order_code" placeholder="输入手机号或订单号查询" style="margin-right:15px;"/>
            <label class="f_left">开始日期：</label>
            <div class="date_box">
                <input type="text" name="start" id="start_date" readonly/>
                <i class="fa fa-calendar"></i>
            </div>
            <label class="f_left">结束日期：</label>
            <div class="date_box">
                <input type="text" name="end" id="end_date" readonly/>
                <i class="fa fa-calendar"></i>
            </div>
            <input type="button" value="搜索" class="btn blue_btn search"/>
        </div>
    </form>
    <div class="cont_box">
        <table border="0" cellspacing="0" cellpadding="0" class="table">

            <tbody>
            <c:forEach items="${sessionScope.list1}" var="a">
<%--                <c:forEach items="${sessionScope.id}" var="s">--%>
                <tr id="1"><!--此处id为进行编辑或删除时该条数据的唯一标识-->
                    <td>${a.bid}</td>
                    <td>${a.money}</td>
                    <td>${a.zhifu}</td>
                    <td>${a.vname}</td>
                    <td>${a.phone}</td>
                    <td>${a.status}</td>
                    <td><fmt:formatDate value="${a.regtime}"></fmt:formatDate></td>
                    <td width="200">
                        <div class="order_remark">${a.remark}</div>
                    </td>
                    <td>
                        <a href="javascript:;" class="table_btn table_info detail_btn" onclick="amount(this,${a.bid})">
                            <i class="fa fa-eye"></i>
                            <span>订单详情</span>
                        </a>
                        <a href="javascript:void(0);" class="table_btn table_edit edit_btn" onclick="bianji(this,${a.bid})">
                            <i class="fa fa-edit"></i>
                            <span>编辑订单</span>
                        </a>
                        <a href="javascript:void(0);" class="table_btn table_del del_btn">
                            <i class="fa fa-recycle"></i>
                            <span>退单</span>
                        </a>
                    </td>
                </tr>
<%--                </c:forEach>--%>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
<!--javascript include-->
<script src="js/jquery-2.2.1.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/other1.js"></script>
<script>
    $(function(){
        $("body").other({tableId:"#table_box",tableWrap:[0,1,2,3,4,7,8],tableAas:[6,"desc"]});
        $("body").tipWindow({method:"delete",Class:".del_btn",even:"click",deleteTxt:"确认要退单吗？",Twidth:"400",Theight:"180",delUrl:"#"});//delUrl 退单请求地址
        // $("body").tipWindow({method:"edit",type:"form",Class:".detail_btn",even:"click",tipTit:"订单详情",Twidth:"800",Theight:"600",editUrl:"order_Detail.jsp"});//editUrl 编辑请求地址
        // $("body").tipWindow({method:"edit",type:"form",Class:".edit_btn",even:"click",tipTit:"编辑订单",Twidth:"800",Theight:"600",editUrl:"order_edit.html"});//editUrl 编辑请求地址
        //订单搜索
        $(".search").click(function(){
            var data = {"startDate":$("#order_shform").find("input[name='start']").val(),"endDate":$("#order_shform").find("input[name='end']").val(),"orderId":$("#order_shform").find("input[name='order_code']").val()};
            $.ajax({
                type:"post",
                url:"search_Order.html",
                data:data,
                success:function(data){
                    $(".table").remove();
                    $(".cont_box").append(data);
                    $("body").other({tableId:"#table_box",tableWrap:[0,1,2,3,4,7,8],tableAas:[6,"desc"]});
                    $("body").tipWindow({method:"delete",Class:".del_btn",even:"click",deleteTxt:"确认要退单吗？",Twidth:"400",Theight:"180",delUrl:"#"});//delUrl 退单请求地址
                    $("body").tipWindow({method:"edit",type:"form",Class:".edit_btn",even:"click",tipTit:"订单详情",Twidth:"800",Theight:"600",editUrl:"${pageContext.request.contextPath}/findXQ"});//editUrl 编辑请求地址
                },
                error:function(data){
                    alert(data);
                }
            });
        });
    });

    function amount(obj,id){
        location.href="<%=path%>/findByIdBilling?bid="+id
    }
    function bianji(obj,id){
        location.href="<%=path%>/findByIdBilling1?bid="+id
    }
</script>
</body>
</html>
